Skip to content

Include DNSSECProof in PaymentSent for BIP 353 proof of payment#4512

Closed
vincenzopalazzo wants to merge 2 commits intolightningdevkit:mainfrom
vincenzopalazzo:claude/priceless-chatelet
Closed

Include DNSSECProof in PaymentSent for BIP 353 proof of payment#4512
vincenzopalazzo wants to merge 2 commits intolightningdevkit:mainfrom
vincenzopalazzo:claude/priceless-chatelet

Conversation

@vincenzopalazzo
Copy link
Contributor

Summary

  • Store DNSSECProof received during BIP 353 Human Readable Name resolution and carry it through the payment lifecycle
  • Add dnssec_proof field to PendingOutboundPayment::AwaitingInvoice, Retryable, HTLCSource::OutboundRoute, and Event::PaymentSent
  • Clone the proof in handle_dnssec_proof before it's consumed by validation, then attach it to the payment state via set_dnssec_proof

This gives users paying via HRN a complete chain of proof: DNS name -> DNSSEC proof -> Offer -> Invoice -> Payment preimage.

Addresses the DNSSECProof part of #3344.

Test plan

  • All 1192 lightning lib tests pass
  • All 37 offers_tests pass
  • All 79 payment_tests pass
  • Serialization uses optional TLV fields for backward compatibility
  • Manual verification with BIP 353 payment flow (requires DNS resolver setup)

🤖 Generated with Claude Code

@ldk-reviews-bot
Copy link

👋 Hi! I see this is a draft PR.
I'll wait to assign reviewers until you mark it as ready for review.
Just convert it out of draft status when you're ready for review!

BOLT12 offers are designed for compactness to fit in QR codes, and can
be "much longer-lived than a particular invoice". These goals are in
tension when constructing blinded paths: BOLT04 allows using either
`short_channel_id` or `next_node_id` in the encrypted_data_tlv for
routing, but each has trade-offs.

Using SCIDs produces smaller encoded offers suitable for QR codes, but
if the referenced channel closes or is modified (e.g., via splicing),
the blinded path breaks and the offer becomes unusable. Using full node
IDs produces larger offers but paths remain valid as long as the node
connection persists, regardless of specific channel lifecycle.

For long-lived offers where stability matters more than size, users may
prefer full node ID paths. This adds a `compact_paths` field to
`DefaultMessageRouter` and a `with_compact_paths` constructor to allow
downstream applications to choose their preferred trade-off. The
default behavior (compact paths enabled) is preserved.
Copy link
Contributor

@tnull tnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should do this. In fact, we previously discussed dropping BIP353 support from lightning entirely (in particular since it's weird HRNs might support different payment methods but here we always can only use lightning).

Rather, users should use bitcoin-payment-instructions directly as LDK Node does.

@vincenzopalazzo vincenzopalazzo force-pushed the claude/priceless-chatelet branch from b12fbee to 8596137 Compare March 25, 2026 12:59
Store the DNSSEC proof received during BIP 353 Human Readable Name
resolution and carry it through the payment lifecycle alongside the
Bolt12Invoice. The proof is stored in PendingOutboundPayment::Retryable
and HTLCSource::OutboundRoute (for restart persistence), and emitted
in the PaymentSent event.

This allows users who pay via HRN to have a complete chain of proof:
DNS name -> DNSSEC proof -> Offer -> Invoice -> Payment preimage.

Addresses the DNSSECProof part of lightningdevkit#3344.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vincenzopalazzo vincenzopalazzo force-pushed the claude/priceless-chatelet branch from 8596137 to 9fd93e8 Compare March 25, 2026 13:00
@vincenzopalazzo
Copy link
Contributor Author

I don't think we should do this. In fact, we previously discussed dropping BIP353 support from lightning entirely

Oh I was not awere of it, I had it on my backlock from one of my older PR, nice so closing it and cleaning one item from my todo :) thanks for the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants